﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace TokenManagementAppMVC.Tools
{
    public static class DateTimeOffsetExtensions
    {
        public static long ToUnixTimeSeconds(this DateTimeOffset offset)
        {
            var epoch = new DateTimeOffset(1970, 1, 1, 0, 0, 0, TimeSpan.Zero);
            return (long)(offset - epoch).TotalSeconds;
        }
    }
}